package com.wicket.okrbff.biz.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrapp.dal.po.mbg.OmsDualHighIndicatorRelationship;
import com.wicket.okrapp.integration.FwAppDualHighIndicatorRelationshipClient;
import com.wicket.okrapp.integration.dto.OmsDualHighIndicatorRelationshipReqDto;
import com.wicket.okrbff.biz.service.DualHighIndicatorRelationshipService;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author  CHS
 * @since 2025-10-02
 *
 *
 * @version 1.0
 */
@Service
public class DualHighIndicatorRelationshipServiceImpl implements DualHighIndicatorRelationshipService {

    @Resource
    FwAppDualHighIndicatorRelationshipClient client;

    /**
     * 查双高标准框架数据列表[2536]
     * gen by moon at 10/15/2022, 9:58:55 PM
     */
    @Trace(operationName = "查双高标准框架数据列表")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
    @Override
    @Transactional(rollbackFor=Exception.class)
    public  List<OmsDualHighIndicatorRelationship>  queryDualHighIndicatorRelationshipList(OmsDualHighIndicatorRelationship obj) {
        return client.list(BeanUtil.toBean(obj, OmsDualHighIndicatorRelationshipReqDto.class)).getData();
    }

    /**
     * 查双高标准框架数据详情[2515]
     * gen by moon at 4/24/2023, 12:54:06 AM
     */
    @Trace(operationName = "查双高标准框架数据详情")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
    @Override
    @Transactional(rollbackFor=Exception.class)
    public  OmsDualHighIndicatorRelationship  queryDualHighIndicatorRelationshipDetail(OmsDualHighIndicatorRelationship obj) {

        return client.detail(BeanUtil.toBean(obj, OmsDualHighIndicatorRelationshipReqDto.class)).getData();
    }

    /**
     * 新增双高标准框架数据[2346]
     * gen by moon at 10/15/2022, 9:58:53 PM
     */
    @Trace(operationName = "新增双高标准框架数据")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
    @Override
    @Transactional(rollbackFor=Exception.class)
    public  String  addDualHighIndicatorRelationship(OmsDualHighIndicatorRelationship obj) {
        return client.add(BeanUtil.toBean(obj, OmsDualHighIndicatorRelationshipReqDto.class)).getData();
    }

    /**
     * 修改双高标准框架数据[2917]
     * gen by moon at 10/15/2022, 9:58:56 PM
     */
    @Trace(operationName = "修改双高标准框架数据")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
    @Override
    @Transactional(rollbackFor=Exception.class)
    public  boolean  updateDualHighIndicatorRelationship(OmsDualHighIndicatorRelationship obj) {
        return  client.update(BeanUtil.toBean(obj, OmsDualHighIndicatorRelationshipReqDto.class)).getData();
    }

    /**
     * 删除双高标准框架数据[4092]
     * gen by moon at 10/15/2022, 9:58:58 PM
     */
    @Trace(operationName = "删除双高标准框架数据")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
    @Override
    @Transactional(rollbackFor=Exception.class)
    public  boolean  deleteDualHighIndicatorRelationship(String id ) {
        OmsDualHighIndicatorRelationship obj = new OmsDualHighIndicatorRelationship();
        obj.setDualHighId(id);
        return client.delete(BeanUtil.toBean(obj, OmsDualHighIndicatorRelationshipReqDto.class)).getData();
    }


    /**
     * 维护双高标准框架数据[2917]
     * gen by moon at 10/15/2022, 9:58:56 PM
     */
    @Trace(operationName = "维护双高标准框架数据")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
    @Override
    @Transactional(rollbackFor=Exception.class)
    public  boolean  changeDualHighIndicatorRelationship(OmsDualHighIndicatorRelationship obj) {
        return  client.change(BeanUtil.toBean(obj, OmsDualHighIndicatorRelationshipReqDto.class)).getData();
    }

}
